package main

import (
	"../io"
	"../board"
)

func main() {
	println("start play")

	allCards := io.NewCards()
	println(allCards)

	rule := board.DefaultRule{}
	outCards, remainCards := rule.Deal(allCards, 3, 3)

	// sort all
	for _, v := range outCards  {
		v.Sort()
	}

	for _, v := range outCards {
		println(v.String())
	}

	println("remain cards:")
	println(remainCards.String())

	//playerCards := outCards[0]

	//println("after sort, player cards:")
	//println(playerCards.String())


	parser := io.NewCardParser()

	for _, playerCards := range outCards {
		cardGroups := parser.Parse(playerCards)

		for _, v := range cardGroups {
			println(v.ToString())
		}
	}

}
